package com.king.gkrpc.client;

import com.king.gkrpc.Peer;
import com.king.gkrpc.codec.Decoder;
import com.king.gkrpc.codec.Encoder;
import com.king.gkrpc.codec.JSONDecoder;
import com.king.gkrpc.codec.JSONEncoder;
import com.king.gkrpc.transport.HttpTransportClient;
import com.king.gkrpc.transport.HttpTransportServer;
import com.king.gkrpc.transport.TransportClient;
import com.king.gkrpc.transport.TransportServer;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.List;

@Data
@NoArgsConstructor
public class RpcClientConfig {
    private Class<? extends TransportClient> transportClientClass = HttpTransportClient.class;

    private Class<? extends Encoder> encoderClass = JSONEncoder.class;

    private Class<? extends Decoder> decoderClass = JSONDecoder.class;

    private Class<? extends TransportSelector> selectorClass = RandomTransportSelector.class;

    private int connectCount = 1;

    private List<Peer> servers = Arrays.asList(
            new Peer("127.0.0.1",3000)
    );
}
